<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupMultiBox</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-size: large;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupMultiBox<span class="style1"> (since 3.26)</span></h2>

  <p>
  Creates a void
  container for composing elements in a irregular grid. It is a box that arranges the elements it contains 
	from top 
	to bottom and from left to right, by distributing the elements in lines 
  or in columns. But its EXPAND attribute does not behave as a regular 
  container, instead it behaves as a regular element expanding into the 
  available space.</p>
<p>
  The child elements are added to the control just like a vbox and hbox, 
  sequentially. Then they are distributed accordingly the ORIENTATION 
  attribute. When ORIENTATION=HORIZONTAL children are distributed from left to 
  right on the first line until the line does not fits more elements according 
  to the multibox current width, then on the second line, and so on. When 
  ORIENTATION=VERTICAL children are distributed from top to bottom on the first 
  column until columns does not fits more elements according to the multibox current 
  height, then on the second column, and so on. </p>
<p>
  Because of that its elements can overlap other elements in the dialog, so the 
  ideal combination is to put the <strong>IupMultiBox</strong> inside an
  <a href="iupscrollbox.html">IupScrollBox</a>.</p>
<p>
  IMPORTANT: the actual element distribution in the container is done only after 
  the natural size of the dialog is computed because it needs the current with 
  or height to determine which elements will fit in the current space according 
  to the orientation. The first time the multibox natural size is computed it 
  returns simply the largest width and the highest height among the children. 
  The next time it will use the size previously calculated with the line/column 
  breaks, to avoid obtaining an outdated layout call <strong>IupRefresh</strong> 
  or <strong>IupMap</strong> before showing the dialog (when the layout will be 
  updated again). </p>
<p>It does not have a native representation.</p>

<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupMultiBox(Ihandle *<strong>child</strong>, ...); [in C]
Ihandle* IupMultiBoxV(Ihandle* <strong>child</strong>, va_list <strong>arglist</strong>); [in C]
Ihandle* IupMultiBoxv(Ihandle **<strong>children</strong>); [in C]
iup.multibox{<strong>child</strong>, ...: ihandle} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
multibox(<strong>child</strong>, ...) [in LED]</pre>
  <p><strong>child</strong>, ... :
  List of the identifiers that will be placed 
  in the box. NULL must be used to define the end of the list in C. It can be 
  empty, but in C must have at least the NULL terminator..</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


  <p><strong>CHILDMAXSIZE</strong> (<font SIZE="3">non inheritable</font>): when 
  defined limits the size of all children to a given maximum size. Uses the 
  format &quot;<i>width</i>x<i>height</i>&quot;. This affects each child size.</p>
<p><strong>CHILDMINSPACE</strong> (<font SIZE="3">non inheritable</font>): when 
defined limits the space occupied by a child to a given minimum size. Uses the 
format &quot;<i>width</i>x<i>height</i>&quot;. This does not affects the children 
size.</p>
<p><a href="../attrib/iup_expand.html">EXPAND</a> (<font SIZE="3">non inheritable*</font>):
  The default value is &quot;YES&quot;. See the documentation of the attribute 
	for EXPAND inheritance.</p>

  <p><b>GAPVERT, CGAPVERT</b>: Defines a vertical space in pixels between 
  elements,
	<strong>CGAPVERT</strong> is in the same units of the <strong>SIZE</strong> 
	attribute for the height. Default: &quot;0&quot;.</p>

  <p><b>GAPHORIZ, CGAPHORIZ</b>: Defines a horizontal space in pixels between 
  elements,
	<strong>CGAP<b>HORIZ</b></strong> is in the same units of the <strong>SIZE</strong> 
	attribute for the height. Default: &quot;0&quot;.</p>
<p><b>NGAPVERT, NCGAPVERT, NGAPHORIZ, NCGAPHORIZ</b> (<font SIZE="3">non inheritable</font>): Same as <strong>
*GAP*</strong> but are non inheritable.</p>
  <p><b>MARGIN, CMARGIN</b>:
  Defines a margin in pixels, <b>CMARGIN </b>is in the same units of the <strong>
	SIZE</strong> attribute. Its value 
  has the format &quot;<i>width</i>x<i>height</i>&quot;,
  where <i>
  width</i> 
  and <i>height</i> 
  are integer values corresponding to the horizontal and vertical margins, 
  respectively. Default: &quot;0x0&quot; (no margin).</p>
<p><b>NMARGIN, NCMARGIN</b> (<font SIZE="3">non inheritable</font>): Same as
<strong>MARGIN</strong> but are non inheritable.</p>
<p><strong>NUMCOL</strong> (read-only): returns the number of columns when 
ORIENTATION=VERTICAL. Returns 0 otherwise.</p>
<p><strong>NUMLIN</strong> (read-only): returns the number of lines when 
ORIENTATION=HORIZONTAL. Returns 0 otherwise.</p>
<p><strong>ORIENTATION</strong> (<font SIZE="3">non inheritable</font>): 
controls the distribution of the children in lines or in columns. Can be: 
HORIZONTAL or VERTICAL. Default: HORIZONTAL. </p>
<p><b>WID</b> (read-only): returns -1 if mapped.</p>

  <blockquote>
    <hr>
</blockquote>

  <p>
  <a href="../attrib/iup_size.html">SIZE</a>,
<a href="../attrib/iup_rastersize.html">RASTERSIZE</a>,
<a href="../attrib/iup_font.html">FONT</a>,
    <a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>, 
	<a href="../attrib/iup_position.html">POSITION</a>, 
<a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>, <a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.</p>

<h3>Attributes (at Children)</h3>

  <p><strong>LINEBREAK</strong> (<font SIZE="3">non inheritable</font>)
	<strong>(at children only)</strong>: when defined at a child force a line 
  break after the child when ORIENTATION=HORIZONTAL. </p>
<p><strong>COLUMNBREAK</strong> (<font SIZE="3">non inheritable</font>)
	<strong>(at children only)</strong>: when defined at a child force a column 
break after the child when ORIENTATION=VERTICAL. </p>

<h3><a name="Notes">Notes</a></h3>

<p>The box can be created with no elements and be dynamic filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.</p>
<p>The box will NOT expand its children in any condition.</p>
<p>The number of elements in a line when ORIENTATION=HORIZONTAL can be very 
different depending on the children sizes and line/column breaks. The same for elements in a column 
when ORIENTATION=VERTICAL.</p>

<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>

<div align="center">
  <center>
  <table border="0" cellpadding="6" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
      <td valign="top"><img src="images/iupmultibox1.png"></td>
      <td valign="top"><img src="images/iupmultibox2.png"></td>
    </tr>
  </table>
  </center>
</div>
<h3><a name="SeeAlso">See Also</a></h3>

<p><a href="iupgridbox.html">IupGridBox</a><a href="iupvbox.html">IupVbox</a>, <a href="iuphbox.html">IupHbox</a></p>


</body>

</html>